<!--
 @description
 @fileName demo.vue
 @author zengqiongying
 @created 2022/10/14 17:12:34
-->
<template>
  <div>
    
    <QupFormContainer :column="2">
      <el-form
        ref="formOrder"
        :model="demoForm"
        label-width="110px"
      >
      <el-form-item label="经销商:">
            <input-with-dialog
              ref="refAddress"
              v-model="receiveAddressData"
              :props="{label:'employName',value:'employCode'}"
              :focus-query="true"
              :remote-url="`https://pandadev.quanyou.com.cn/top2-delivery/api/v1/employ/page?type=1`"
              request-method="get"
              param-field="paramKeyword"
              multiple              
              :config="{
                title:'列表',
                width:'600px',
                interfacePath:'https://pandadev.quanyou.com.cn/top2-delivery/api/v1/employ/page?type=1',
                method:'get',
                paramField:'paramKeyword',
                filtersRaw:[],
                rowKey:'employId',
                setting:[
                  {prop:'employCode',title:'编码',width:80},
                  {prop:'employName',title:'名称',width:200}
                ],
                apiHeader:{
                  'Distributor':'%7B%22orgCode%22%3A%22K1001749%22%2C%22orgName%22%3A%22%E5%9B%9B%E5%B7%9D%E7%9C%81%E5%B7%B4%E4%B8%AD%E5%B8%82%E5%B7%B4%E5%B7%9E%E5%8C%BA%E4%BB%BB%E6%B3%A2%22%7D'
                }
              }"
            />
          </el-form-item>
      <el-form-item
          prop="buyChannel"
          label="购买渠道"
        >
          <QupDictSelect
            placeholder="请选择"
            dict-type-code="PURCHASE_CHANNEL"
            domainCode="marketing"
            appCode="call-center"
            :code.sync="demoForm.buyChannel"
            :name.sync="demoForm.buyChannelName"
            filterable
            :multiple="true"
            :excludes="[3,4]"
          ></QupDictSelect>
        </el-form-item>
        <el-form-item prop="shopCode2" label="店铺">
          <QupSearchSelectPicker
            url="https://uacdev.quanyou.com.cn/select-service/api/v1/eco/platform/page"
            placeholder="请选择"
            lable-name="name"
            value-name="code"
            method="post"
            :params="{query:{},type:0}"
            :value.sync="demoForm.shopCode2"
            :multiple="true"
            :includes="excludesFunc"
          ></QupSearchSelectPicker>
        </el-form-item>
        <el-form-item prop="shopCode3" label="客户来源">
          <QupSearchSelectPicker
            url="https://qup2dev.quanyou.com.cn/data-dict/api/v2/dictionary/child"
            placeholder="请选择"
            lable-name="dictName"
            value-name="dictCode"
            method="post"
            :params="{
              query:{
                appCode:'top2-crm',
                domainCode:'marketing',
                parentDictTypeCode:'DIS_CUSTOMER_PRIMARY_SOURCE',
                parentDictCode:'Offline',
              },
              type:2
            }"
            :value.sync="demoForm.shopCode3"
            :multiple="true"
          ></QupSearchSelectPicker>
        </el-form-item>
          <el-form-item prop="thirdSourceVal" label="三级来源0">
            <qup-search-select-picker
              placeholder="请选择三级来源"
              :url="`/data-dict/api/v2/dictionary/child`"
              :params="{query:{parentDictId:'39d4a2a4-df79-409e-94a2-a4df79409e33'},type:0}"
              lable-name="dictName"
              value-name="dictCode"
              method="get"
              :value.sync="demoForm.thirdSourceVal"
              @data-change="getList"
            />
            <!-- :optionData="[
              {dictCode:'ActiveMarketing',dictName:'签名营销'}
              ]" -->
          </el-form-item>
        <!-- <el-form-item prop="firstSource" label="一级来源">
            <qup-dict-select
              placeholder="请选择一级来源"
              dict-type-code="CRM_CUSTOMER_PRIMARY_SOURCE"
              domain-code="marketing"
              app-code="top2-crm"
              :code.sync="demoForm.firstSource"
              filterable
              is-emit
              :emit-arr="['dictId']"
              :dict-id.sync="demoForm.firstSourceDictId"
            />
          </el-form-item>
          <el-form-item prop="secondSource" label="二级来源">
            <qup-search-select-picker
              placeholder="请选择二级来源"
              :url="`/data-dict/api/v2/dictionary/child`"
              lable-name="dictName"
              value-name="dictCode"
              method="get"
              must-pid
              :parent-id="demoForm.firstSourceDictId"
              :disabled="!demoForm.firstSourceDictId"
              :params="{query:{parentDictId:demoForm.firstSourceDictId},type:0}"
              :value.sync="demoForm.secondSource"
            />
          </el-form-item>
          <el-form-item prop="thirdSource" label="三级来源">
            <qup-search-select-picker
              placeholder="请选择三级来源"
              :url="`/data-dict/api/v2/dictionary/child`"
              lable-name="dictName"
              value-name="dictCode"
              method="get"
              must-pid
              :parent-id="demoForm.secondSourceDictId"
              :disabled="!demoForm.secondSourceDictId"
              :params="{query:{parentDictId:demoForm.secondSourceDictId},type:0}"
              :value.sync="demoForm.thirdSource"
            />
          </el-form-item>
          <el-form-item prop="thirdSource" label="三级来源1">
            <qup-search-select-picker
              placeholder="请选择三级来源"
              :url="`/data-dict/api/v2/dictionary/child`"
              lable-name="dictName"
              value-name="dictCode"
              method="get"
              must-pid
              parent-id="39d4a2a4-df79-409e-94a2-a4df79409e33"
              :params="{query:{parentDictId:'39d4a2a4-df79-409e-94a2-a4df79409e33'},type:0}"
              :value.sync="demoForm.thirdSource"
            />
          </el-form-item> -->
        <el-form-item align="right" label-width="0px" show more style="white-space: nowrap;">
          <el-button size="mini">重置</el-button>
          <el-button type="primary" enter size="mini">查询</el-button>
        </el-form-item>
      </el-form>
    </QupFormContainer>
  </div>
</template>

<script>
export default {
  name: '',
  components: {},
  filters: {},
  mixins: [],
  data() {
    return {
      receiveAddressData:[],
      demoForm:{
        buyChannel:[1,2],
        buyChannelName:[],
        shopCode2:[null],
        shopCode3:[],
        thirdSourceVal:'ActiveMarketing',
        "firstSource": "Store",
        "secondSource": "ActiveMarketing",
        "thirdSource": "ActiveMarketing",
        "firstSourceDictId": "5fc117cb-dadc-4da1-8117-cbdadc1da139",
        "secondSourceDictId": "39d4a2a4-df79-409e-94a2-a4df79409e33",
      },
    }
  },

  computed: {},

  created() {},
  activated() {},

  mounted() {},

  methods: {
    getList(data){
      console.log('getList',data)
    },
   excludesFunc(){
      return ['kuaishou']
      return new Promise((resolve,reject)=>{
        setTimeout(() => {
          resolve(['kuaishou','taobao'])
        }, 1000);
      })
    }
  }
}

</script>
<style lang='scss' scoped>
</style>
